class Menu {
    constructor(props) {
        this.title = props.title;
        this.icon = props.icon;
    }
    isDisabled() {
        return false;
    }
    exec() {
        // 菜单的逻辑
    }
}
class ButtonMenu extends Menu {
    constructor(props) {
        super(props);
    }
    exec() {
        console.log('hello');
    }
}
class SelectMenu extends Menu {
    constructor(props) {
        super(props);
    }
    exec() {
        return ['item1', 'item2', 'item3'];
    }
}
class ModalMenu extends Menu {
    constructor(props) {
        super(props);
    }
    exec() {
        const dom = document.createElement('div');
        dom.innerHTML = 'modal';
        return dom;
    }
}

const modalMenu = new ModalMenu({ title: "标题", icon: 'modal' });
console.log('modalMenu', modalMenu);
const dom = modalMenu.exec(0);
console.log('dom', dom);
document.body.appendChild(dom)